
import java.util.Scanner;
class JTACOGRA {
    public static void main(String[] args) {
        Scanner entrada = new Scanner(System.in);
        int T,V, total = 0;
        int N = entrada.nextInt();
        for (int i = 0; i < N; i++) {
                T = entrada.nextInt();
                V = entrada.nextInt();
                total +=(V*T); 
            }
        System.out.println(total);
    }
}
